package com.xcf.service.business.finance.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xcf.dao.DaoSupport;
import com.xcf.service.business.finance.CostCheckListService;
import com.xcf.util.PageData;
@Service
@Transactional(rollbackFor = Exception.class,propagation = org.springframework.transaction.annotation.Propagation.REQUIRED,readOnly=false)
public class CostCheckListServiceImpl implements CostCheckListService{
	@Resource
	private DaoSupport dao;
	@Override
	public List<Map> findCostCheckList(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findCostCheckList", pd);
	}
	@Override
	public List<Map> findInvoice() throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("costCheckList.findInvoice", null);
	}
	@Override
	public List<Map> findBillCode() throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("costCheckList.findBillCode", null);
	}
	@Override
	public void saveCostCheckList(PageData pd) throws Exception {
		dao.save("costCheckList.saveInfo", pd);
		
	}
	@Override
	public List<Map> findDepartment() throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findDepartment", null);
	}
	@Override
	public PageData findCostCheckListById(String id) throws Exception {
		// TODO Auto-generated method stub
		return (PageData) dao.findForObject("costCheckList.findCostCheckListById", id);
	}
	@Override
	public List<Map> findPaymentNum(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findPaymentNum", pd);
	}
	@Override
	public List<Map> findPaymentInfo(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findPaymentInfo", pd);
	}
	@Override
	public void updateInfo(PageData pd) throws Exception {
		dao.update("costCheckList.updateCostInfo", pd);
		
	}
	@Override
	public List<Map> findPaymentInfoWhere(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findPaymentNumWhere", pd);
	}
	@Override
	public List<Map> findIncomeInfo(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findIncomeInfo", pd);
	}
	@Override
	public List<Map> findLoanInfo(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		 return (List<Map>) dao.findForList("costCheckList.findLoanInfo", pd);
	}
	@Override
	public void saveCostInfo(PageData pd) throws Exception {
		dao.save("costCheckList.saveCostInfo", pd);
		
	}
	@Override
	public void saveCostDetail(PageData pd) throws Exception {
		dao.save("costCheckList.saveCostDetail", pd);
		
	}
	@Override
	public void saveCostLoanDetail(PageData pd) throws Exception {
		dao.save("costCheckList.saveCostLoanDetail", pd);
		
	}
	@Override
	public void saveCostIncomeDetail(PageData pd) throws Exception {
		dao.save("costCheckList.saveCostIncomeDetail", pd);
		
	}
	@Override
	
	public Object getPaymentCode(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		dao.findForObject("costCheckList.getPaymentCode", pd);
		return ((Map<String,Object>)pd.get("pd")).get("paymentCode");
	}
	@Override
	public void updateCostData(PageData pd) throws Exception {
		dao.update("costCheckList.updateCostData", pd);
		
	}
	@Override
	public void updateCostDetail(PageData pd) throws Exception {
		dao.update("costCheckList.updateCostDetail", pd);
		
	}
	@Override
	public void updateCostLoanDetail(PageData pd) throws Exception {
		dao.update("costCheckList.updateCostLoanDetail", pd);
		
	}
	@Override
	public void updateCostIncomeDetail(PageData pd) throws Exception {
		dao.update("costCheckList.updateCostIncomeDetail", pd);
		
	}
	@Override
	public List<Map> findIncomeInfoBy(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findIncomeInfoBy", pd);
	}
	@Override
	public PageData findCostInfoLoanById(String id) throws Exception {
		
		return (PageData) dao.findForObject("costCheckList.saveCostInfoLoanById", id);
	}
	@Override
	public void saveCostLoanRecordDetail(PageData pd) throws Exception {
		dao.save("costCheckList.saveCostLoanRecordDetail", pd);
		
	}
	@Override
	public void deleteCostInfoLoan(String id) throws Exception {
		dao.delete("costCheckList.deleteCostInfoLoan", id);
		
	}
	@Override
	public List<Map> findInfo(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("costCheckList.findinfo", pd);
	}


	
}
